﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Singular
{
    public partial class ILoveAnimalsConfig : Form
    {
        public ILoveAnimalsConfig()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (Settings.SingularSettings.Instance.Druid.Shapeform == 0)
            {
                radioButton1.Select();
            }
            if (Settings.SingularSettings.Instance.Druid.Shapeform == 1)
            {
                radioButton2.Select();
            }
            if (Settings.SingularSettings.Instance.Druid.Shapeform == 2)
            {
                radioButton3.Select();
            }
            if (Settings.SingularSettings.Instance.Druid.Shapeform == 3)
            {
                radioButton4.Select();
            }
            checkBox1.Checked = Settings.SingularSettings.Instance.DisableAllMovement;
            checkBox2.Checked = Settings.SingularSettings.Instance.DisableAllTargeting;
            checkBox3.Checked = Settings.SingularSettings.Instance.UseInstanceRotation;
            numericUpDown1.Value = Settings.SingularSettings.Instance.MinHealth;
            numericUpDown2.Value = Settings.SingularSettings.Instance.MinMana;
            checkBox4.Checked = Settings.SingularSettings.Instance.WaitForResSickness;
            checkBox5.Checked = Settings.SingularSettings.Instance.UseRacials;
            checkBox6.Checked = Settings.SingularSettings.Instance.ShadowmeldThreatDrop;
            numericUpDown3.Value = Settings.SingularSettings.Instance.GiftNaaruHP;
            checkBox7.Checked = Settings.SingularSettings.Instance.UseAlchemyFlasks;
            checkBox8.Checked = Settings.SingularSettings.Instance.Trinket1;
            if (Settings.SingularSettings.Instance.Trinket1Usage == TrinketUsage.OnCooldown)
            {
                radioButton5.Select();
            }
            if (Settings.SingularSettings.Instance.Trinket1Usage == TrinketUsage.LowHealth)
            {
                radioButton6.Select();
            }
            if (Settings.SingularSettings.Instance.Trinket1Usage == TrinketUsage.CrowdControlled)
            {
                radioButton7.Select();
            }
            checkBox9.Checked = Settings.SingularSettings.Instance.Trinket2;
            if (Settings.SingularSettings.Instance.Trinket2Usage == TrinketUsage.OnCooldown)
            {
                radioButton8.Select();
            }
            if (Settings.SingularSettings.Instance.Trinket2Usage == TrinketUsage.LowHealth)
            {
                radioButton9.Select();
            }
            if (Settings.SingularSettings.Instance.Trinket2Usage == TrinketUsage.CrowdControlled)
            {
                radioButton10.Select();
            }
            /*Cat Part*/
            numericUpDown4.Value = Settings.SingularSettings.Instance.Druid.CatNormalAoe;
            checkBox10.Checked = Settings.SingularSettings.Instance.Druid.CatNormalSafeBerserk;
            checkBox11.Checked = Settings.SingularSettings.Instance.Druid.CatNormalUseFeralCharge;
            checkBox12.Checked = Settings.SingularSettings.Instance.Druid.CatNormalPullStealth;
            numericUpDown5.Value = Settings.SingularSettings.Instance.Druid.CatNormalSwitchAdds;
            numericUpDown6.Value = Settings.SingularSettings.Instance.Druid.CatNormalSwitchHealth;
            numericUpDown7.Value = Settings.SingularSettings.Instance.Druid.CatRaidAoe;
            checkBox13.Checked = Settings.SingularSettings.Instance.Druid.CatRaidBerserk;
            checkBox14.Checked = Settings.SingularSettings.Instance.Druid.CatRaidTigers;
            checkBox15.Checked = Settings.SingularSettings.Instance.Druid.CatRaidUseFeralCharge;
            checkBox16.Checked = Settings.SingularSettings.Instance.Druid.CatRaidRezz;
            checkBox17.Checked = Settings.SingularSettings.Instance.Druid.CatRaidRebuff;
            numericUpDown8.Value = Settings.SingularSettings.Instance.Druid.Barkskin;
            numericUpDown9.Value = Settings.SingularSettings.Instance.Druid.SurvivalInstinctsHealth;
            checkBox18.Checked = Settings.SingularSettings.Instance.Druid.BuffMdw;
            /*Bear Part*/
            numericUpDown10.Value = Settings.SingularSettings.Instance.Druid.BearNormalAoe;
            checkBox19.Checked = Settings.SingularSettings.Instance.Druid.BearNormalSafeBerserk;
            checkBox20.Checked = Settings.SingularSettings.Instance.Druid.BearNormalUseFeralCharge;
            numericUpDown11.Value = Settings.SingularSettings.Instance.Druid.BearRaidAoe;
            checkBox21.Checked = Settings.SingularSettings.Instance.Druid.BearRaidBerserk;
            checkBox22.Checked = Settings.SingularSettings.Instance.Druid.BearRaidBerserkFun;
            checkBox23.Checked = Settings.SingularSettings.Instance.Druid.BearRaidCooldown;
            checkBox24.Checked = Settings.SingularSettings.Instance.Druid.BearRaidUseFeralCharge;
            checkBox25.Checked = Settings.SingularSettings.Instance.DisableTankTargetSwitching;
            checkBox26.Checked = Settings.SingularSettings.Instance.EnableTaunting;
            numericUpDown12.Value = Settings.SingularSettings.Instance.Druid.SurvivalInstinctsHealth;
            numericUpDown13.Value = Settings.SingularSettings.Instance.Druid.Barkskin;
            numericUpDown14.Value = Settings.SingularSettings.Instance.Druid.FrenziedRegenerationHealth;
            checkBox27.Checked = Settings.SingularSettings.Instance.Druid.CatRaidWarning;
            checkBox28.Checked = Settings.SingularSettings.Instance.Druid.CatRaidDash;
            checkBox29.Checked = Settings.SingularSettings.Instance.Druid.CatRaidStampeding;
            checkBox30.Checked = Settings.SingularSettings.Instance.Druid.CatRaidButtons;
            checkBox31.Checked = Settings.SingularSettings.Instance.Druid.Interrupt;
            numericUpDown15.Value =  Settings.SingularSettings.Instance.Druid.NonRestoLifebloom;
            numericUpDown16.Value = Settings.SingularSettings.Instance.Druid.NonRestoRejuvenation;
            numericUpDown17.Value = Settings.SingularSettings.Instance.Druid.NonRestoRegrowth;
            numericUpDown18.Value = Settings.SingularSettings.Instance.Druid.NonRestoHealingTouch;
            numericUpDown19.Value = Settings.SingularSettings.Instance.Druid.NonRestoprocc;
            checkBox32.Checked = Settings.SingularSettings.Instance.Druid.NoHealBalanceAndFeral;
            checkBox33.Checked = Settings.SingularSettings.Instance.Druid.RaidHealNonCombat;
            numericUpDown20.Value = Settings.SingularSettings.Instance.Druid.RaidCatProccHeal;
            checkBox34.Checked = Settings.SingularSettings.Instance.Druid.RaidCatProwl;

            /* PVP */

            numericUpDown21.Value = Settings.SingularSettings.Instance.Druid.PvPHealthSwitch;
            numericUpDown22.Value = Settings.SingularSettings.Instance.Druid.PvPAddSwitch;
            checkBox35.Checked = Settings.SingularSettings.Instance.Druid.PvPBerserksafe;
            checkBox36.Checked = Settings.SingularSettings.Instance.Druid.PvPInterrupt;
            checkBox37.Checked = Settings.SingularSettings.Instance.Druid.PvPSnared;
            checkBox38.Checked = Settings.SingularSettings.Instance.Druid.PvPRooted;
            checkBox39.Checked = Settings.SingularSettings.Instance.Druid.PvPccAdd;
            numericUpDown28.Value = Settings.SingularSettings.Instance.Druid.PvPLifeBloom;
            numericUpDown27.Value = Settings.SingularSettings.Instance.Druid.PvPReju;
            numericUpDown26.Value = Settings.SingularSettings.Instance.Druid.PvPRegrowth;
            numericUpDown25.Value = Settings.SingularSettings.Instance.Druid.PvPHealingTouch;
            numericUpDown24.Value = Settings.SingularSettings.Instance.Druid.PvPProcc;
            if (Settings.SingularSettings.Instance.Druid.PvPpHealBool == 0)
            {
                radioButton11.Select();
            }
            if (Settings.SingularSettings.Instance.Druid.PvPpHealBool == 1)
            {
                radioButton12.Select();
            }
            if (Settings.SingularSettings.Instance.Druid.PvPpHealBool == 2)
            {
                radioButton13.Select();
            }
        

        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if(radioButton1.Checked)
            {
                Settings.SingularSettings.Instance.Druid.Shapeform = 0;
            }
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton2.Checked)
            {
                Settings.SingularSettings.Instance.Druid.Shapeform = 1;
            }
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton3.Checked)
            {
                Settings.SingularSettings.Instance.Druid.Shapeform = 2;
            }
        }

        private void radioButton4_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton4.Checked)
            {
                Settings.SingularSettings.Instance.Druid.Shapeform = 3;
            }
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.DisableAllMovement = checkBox1.Checked;
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.DisableAllTargeting = checkBox2.Checked;
        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.UseInstanceRotation = checkBox3.Checked;
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.MinHealth = (int) numericUpDown1.Value;
        }

        private void numericUpDown2_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.MinMana = (int) numericUpDown2.Value;
        }

        private void checkBox4_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.WaitForResSickness = checkBox4.Checked;
        }

        private void checkBox5_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.UseRacials = checkBox5.Checked;
        }

        private void checkBox6_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.ShadowmeldThreatDrop = checkBox6.Checked;
        }

        private void numericUpDown3_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.GiftNaaruHP = (int) numericUpDown3.Value;
        }

        private void checkBox7_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.UseAlchemyFlasks = checkBox7.Checked;
        }

        private void checkBox8_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Trinket1 = checkBox8.Checked;
        }

        private void radioButton5_CheckedChanged(object sender, EventArgs e)
        {
            if(radioButton5.Checked)
            {
                Settings.SingularSettings.Instance.Trinket1Usage = TrinketUsage.OnCooldown;
            }
        }

        private void radioButton6_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton6.Checked)
            {
                Settings.SingularSettings.Instance.Trinket1Usage = TrinketUsage.LowHealth;
            }
        }

        private void radioButton7_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton7.Checked)
            {
                Settings.SingularSettings.Instance.Trinket1Usage = TrinketUsage.CrowdControlled;
            }
        }

        private void checkBox9_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Trinket2 = checkBox9.Checked;
        }

        private void radioButton8_CheckedChanged(object sender, EventArgs e)
        {
            if(radioButton8.Checked)
            {
                Settings.SingularSettings.Instance.Trinket2Usage = TrinketUsage.OnCooldown;
            }
        }

        private void radioButton9_CheckedChanged(object sender, EventArgs e)
        {
            if(radioButton9.Checked)
            {
                Settings.SingularSettings.Instance.Trinket2Usage = TrinketUsage.LowHealth;
            }
        }

        private void radioButton10_CheckedChanged(object sender, EventArgs e)
        {
            if(radioButton10.Checked)
            {
                Settings.SingularSettings.Instance.Trinket2Usage = TrinketUsage.CrowdControlled;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Save();
            Close();
        }

        /* Cat Part */

        private void numericUpDown4_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatNormalAoe = (int) numericUpDown4.Value;
        }

        private void checkBox10_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatNormalSafeBerserk = checkBox10.Checked;
        }

        private void checkBox11_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatNormalUseFeralCharge = checkBox11.Checked;
        }

        private void checkBox12_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatNormalPullStealth = checkBox12.Checked;
        }

        private void numericUpDown5_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatNormalSwitchAdds = (int) numericUpDown5.Value;
        }

        private void numericUpDown6_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatNormalSwitchHealth = (int) numericUpDown6.Value;
        }

        private void numericUpDown7_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidAoe = (int) numericUpDown7.Value;
        }

        private void checkBox13_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidBerserk = checkBox13.Checked;
        }

        private void checkBox14_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidTigers = checkBox14.Checked;
        }

        private void checkBox15_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidUseFeralCharge = checkBox15.Checked;
        }

        private void checkBox16_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidRezz = checkBox16.Checked;
        }

        private void checkBox17_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidRebuff = checkBox17.Checked;
        }

        private void numericUpDown8_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.Barkskin = (int) numericUpDown8.Value;
        }

        private void numericUpDown9_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.SurvivalInstinctsHealth = (int) numericUpDown9.Value;
        }

        private void checkBox18_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BuffMdw = checkBox18.Checked;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Save();
            Close();
        }

        /*Bear Part*/

        private void numericUpDown10_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BearNormalAoe = (int) numericUpDown10.Value;
        }

        private void checkBox19_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BearNormalSafeBerserk = checkBox19.Checked;
        }

        private void checkBox20_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BearNormalUseFeralCharge = checkBox20.Checked;
        }

        private void numericUpDown11_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BearRaidAoe = (int) numericUpDown11.Value;
        }

        private void checkBox21_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BearRaidBerserk = checkBox21.Checked;
        }

        private void checkBox22_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BearRaidBerserkFun = checkBox22.Checked;
        }

        private void checkBox23_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BearRaidCooldown = checkBox23.Checked;
        }

        private void checkBox24_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.BearRaidUseFeralCharge = checkBox24.Checked;
        }

        private void numericUpDown13_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.Barkskin = (int) numericUpDown13.Value;
        }

        private void numericUpDown12_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.SurvivalInstinctsHealth = (int)numericUpDown12.Value;
        }

        private void numericUpDown14_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.FrenziedRegenerationHealth = (int) numericUpDown14.Value;
        }

        private void checkBox25_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.DisableTankTargetSwitching = checkBox25.Checked;     
        }

        private void checkBox26_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.EnableTaunting = checkBox26.Checked;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Save();
            Close();
        }

        private void checkBox27_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidWarning = checkBox27.Checked;
        }

        private void checkBox28_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidDash = checkBox28.Checked;
        }

        private void checkBox29_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidStampeding = checkBox29.Checked;
        }

        private void checkBox30_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.CatRaidButtons = checkBox30.Checked;
        }

        private void checkBox31_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.Interrupt = checkBox31.Checked;
        }

        private void numericUpDown15_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.NonRestoLifebloom = (int) numericUpDown15.Value;
        }

        private void numericUpDown16_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.NonRestoRejuvenation = (int) numericUpDown16.Value;
        }

        private void numericUpDown17_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.NonRestoRegrowth = (int) numericUpDown17.Value;
        }

        private void numericUpDown18_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.NonRestoHealingTouch = (int) numericUpDown18.Value;
        }

        private void numericUpDown19_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.NonRestoprocc = (int) numericUpDown19.Value;
        }

        private void checkBox32_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.NoHealBalanceAndFeral = checkBox32.Checked;
        }

        private void checkBox33_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.RaidHealNonCombat = checkBox33.Checked;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Save();
            Close();
        }

        private void numericUpDown20_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.RaidCatProccHeal = (int) numericUpDown20.Value;
        }

        private void checkBox34_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.RaidCatProwl = checkBox34.Checked;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Save();
            Close();
        }

        private void numericUpDown21_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPHealthSwitch = (int) numericUpDown21.Value;
        }

        private void numericUpDown22_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPAddSwitch = (int)numericUpDown22.Value;
        }

        private void checkBox35_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPBerserksafe = checkBox35.Checked;
        }

        private void checkBox36_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPInterrupt = checkBox36.Checked;
        }

        private void checkBox37_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPSnared = checkBox37.Checked;
        }

        private void checkBox38_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPRooted = checkBox38.Checked;
        }

        private void checkBox39_CheckedChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPccAdd = checkBox39.Checked;
        }

        private void numericUpDown28_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPLifeBloom = (int) numericUpDown28.Value;
        }

        private void numericUpDown27_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPReju = (int)numericUpDown27.Value;
        }

        private void numericUpDown26_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPRegrowth = (int)numericUpDown26.Value;
        }

        private void numericUpDown25_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPHealingTouch = (int)numericUpDown25.Value;
        }

        private void numericUpDown24_ValueChanged(object sender, EventArgs e)
        {
            Settings.SingularSettings.Instance.Druid.PvPProcc = (int)numericUpDown24.Value;
        }

        private void radioButton11_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton11.Checked)
            {
                Settings.SingularSettings.Instance.Druid.PvPpHealBool = 0;
            }
        }

        private void radioButton12_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton12.Checked)
            {
                Settings.SingularSettings.Instance.Druid.PvPpHealBool = 1;
            }
        }

        private void radioButton13_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton13.Checked)
            {
                Settings.SingularSettings.Instance.Druid.PvPpHealBool = 2;
            }
        }



 



    }
}
